package util;

import java.io.UnsupportedEncodingException;
import java.util.ResourceBundle;

public class Properties {
	private static final String CONFIGRATION = "config";

	/**
	 * 用于载入消息的ResourceBundle
	 */
	private static ResourceBundle msgRb = null;

	/**
	 * 将构造函数设置成private，防止被实例化
	 */
	private Properties()
	{}
	public static String getProperties(final String key)
	{String s=null;
		if (msgRb == null)
		{
			msgRb = ResourceBundle.getBundle(CONFIGRATION);
		}
		try {
			s= new String(msgRb.getString(key).getBytes("ISO8859-1"),"UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return s;
	}
	
//	public static void main(String[] args) {
//		System.out.println(getProperties("systemName"));
//	}
}
